package com.dashan.frontend.client.model;

import java.util.Date;



public class Position {
    private Date timestamp;
    private double longitude;
    private double latitude;
    private double accuracy;
    private boolean current;
    
    public Position(double lon, double lat,
            double accuracy, Date timestamp) {
        this.longitude = lon;
        this.latitude = lat;
        this.accuracy = accuracy;
        this.timestamp = timestamp;
        this.current = true;
    }

    public Position(String lng_lat_acc_str, Date timestamp) {
        String[] lng_lat_acc = lng_lat_acc_str.split(", ");
        this.longitude = Double.parseDouble(lng_lat_acc[0]);
        this.latitude = Double.parseDouble(lng_lat_acc[1]);
        this.accuracy = Double.parseDouble(lng_lat_acc[2]);
        this.timestamp = timestamp; 
    }

    public Date getTimestamp() {
        return timestamp;
    }

    public double getLongitude() {
        return longitude;
    }

    public double getLatitude() {
        return latitude;
    }

    public double getAccuracy() {
        return accuracy;
    }

    public boolean isCurrent() {
        return current;
    }
}
